#coding:utf-8
'''将最开始一个文件里面的配置文件分出来'''
import redis


class Config(object):
    '''基本配置文件'''

    # mysql数据库,sqlalchemy
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/aijiazufang'
    SQLALCHEMY_TRACK_MODIFICATIONS = True

    # redis 配置
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    # flask-session配置,去flaks-session中查到
    SESSION_TYPE = 'redis'
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400  # session数据的有效期,单位秒
    SESSION_USE_SIGNER = True  # 对cookie中的session__id进行隐藏处理,并且需要设置seceret_key
    SECRET_KEY = 'afekl;qrt14'

class DevelopmentConfig(Config):
    DEBUG = True

class ProductionConfig(Config):
    pass


config = {
    'develop':DevelopmentConfig,
    'produce':ProductionConfig
}